<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
$itemid = JRequest::getVar('Itemid');
//var_dump($this->category);die;
?>
<?php if(in_array($itemid,array(159))) : ?>
	<h1>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	</h1>
<?php  endif; ?>
{module Breadcrumbs}
<div class="clear"></div>
<div class="min-content">
	<?php if (empty($this->items)) : ?>
	<?php if ($this->params->get('show_no_articles', 1)) : ?>
	<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
	<?php endif; ?>
	<?php endif; ?>
	<?php foreach ($this->items as $key => &$item) : ?>
	<?php $params = $item->params; ?>
	<?php $author =  $item->author; ?>
	<?php $author = ($item->created_by_alias ? $item->created_by_alias : $author);?>
	<?php $catid =$item->catid; ?>
	<?php $link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $catid)); ?>
	<?php
		$images = json_decode($item->images);
		$image = is_file($images->image_intro)?$images->image_intro:$templatepath.'/src/images/no-image.gif';
	?>	
	<div class="min-item">
		<h3><a href="<?php echo $link; ?>"><?php echo $item->title; ?></a></h3>
		<h4><?php echo JHtml::date($item->created , 'd F Y');?></h4>
		<p><?php echo JHtml::_('string.truncate', strip_tags($item->introtext), $params->get('readmore_limit')); ?><a href="<?php echo $link; ?>">[...]</a></p>
		<!--div class="face">
				   <div id="fb-root"></div>
					<script>(function(d, s, id) {
					  var js, fjs = d.getElementsByTagName(s)[0];
					  if (d.getElementById(id)) {return;}
					  js = d.createElement(s); js.id = id;
					  js.src = "//connect.facebook.net/da_DK/all.js#xfbml=1";
					  fjs.parentNode.insertBefore(js, fjs);
					}(document, 'script', 'facebook-jssdk'));</script>
				   <div class="fb-like" data-href="<?php echo $link; ?>" data-send="false" data-layout="button_count" data-width="50" data-show-faces="false">
				   </div>    
				 </div-->
	</div><!--.min-item-->
	<?php endforeach; ?>
	
 
	<?php if (($this->params->def('show_pagination', 1) == 1  || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>		
					<?php echo $this->pagination->getPagesLinks(); ?>
	<?php  endif; ?>

	
</div><!--.min-content-->
<?php if(in_array($itemid,array(159))) : ?>
<script type="text/javascript">      
	$(document).ready( function(){
		var html = $('#content-right h1:first').clone(true);
		$('#content-left').prepend(html);
		$('#content-right h1').remove();
	});
</script>
<?php  endif; ?>




<?php return;?>



<?php return; ?>
<div class="category-list<?php echo $this->pageclass_sfx;?>">

	<?php if ($this->params->get('show_page_heading')) : ?>
	<h1>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	</h1>
	<?php endif; ?>

	<?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
	<h2>
		<?php echo $this->escape($this->params->get('page_subheading')); ?>
		<?php if ($this->params->get('show_category_title')) : ?>
			<span class="subheading-category"><?php echo $this->category->title;?></span>
		<?php endif; ?>
	</h2>
	<?php endif; ?>

	<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
	<div class="category-desc">
		<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
			<img src="<?php echo $this->category->getParams()->get('image'); ?>"/>
		<?php endif; ?>
		<?php if ($this->params->get('show_description') && $this->category->description) : ?>
			<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
		<?php endif; ?>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<div class="cat-items">
		<?php echo $this->loadTemplate('articles'); ?>
	</div>

	<?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
	<div class="cat-children">
		<h3>
			<?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
		</h3>

		<?php echo $this->loadTemplate('children'); ?>
	</div>
	<?php endif; ?>
</div>
